package main

import "fmt"

type cacheClosure func() map[string]interface{}

func main() {
	cacheFunc := func() map[string]interface{} {
		var data = make(map[string]interface{})

		data["foo"] = "bar"

		return data
	}

	res := test(cacheFunc)
	fmt.Println(res)

	res1 := test1()
	fmt.Println(res1)
}

func test(closure cacheClosure) map[string]interface{} {
	return closure()
}

func test1() (res Res) {
	return
}

type Res struct {
	code int
	msg  string
	data map[string]interface{}
}
